package com.sample.mapping;

import java.util.LinkedHashMap;

import javax.persistence.Column;


//rowid is postid and new post is created when next button is cliked after all caption read 
public class PostCaptionMapping<T> extends AbstractMapping<T> {

	@Column(name = "generateTimeId")
	private LinkedHashMap<T,T> captionMap;

	public LinkedHashMap<T,T> getMap() {
		return captionMap;
	}

	public void setMap(LinkedHashMap<T,T> map) {
		this.captionMap = map;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result
				+ ((captionMap == null) ? 0 : captionMap.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		PostCaptionMapping other = (PostCaptionMapping) obj;
		if (captionMap == null) {
			if (other.captionMap != null)
				return false;
		} else if (!(captionMap.size()== other.getMap().size()))
			return false;
		return true;
	}


}
